﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MattDotson.GlobalToolkit
{
    /// <summary>
    /// Interface for implementations of a currency converter which can be used by the <see cref="Currency"/> type.
    /// </summary>
    public interface ICurrencyConverter
    {
        /// <summary>
        /// Determines whether this instance can convert the specified iso code A.
        /// </summary>
        /// <param name="fromCurrency">The currency to convert from.</param>
        /// <param name="toCurrency">The currency to convert to.</param>
        /// <returns>
        /// 	<c>true</c> if this instance can convert the specified currencies; otherwise, <c>false</c>.
        /// </returns>
        bool CanConvert(CurrencyInfo fromCurrency, CurrencyInfo toCurrency);

        /// <summary>
        /// Converts a currency to another currency using the latest conversion rates.
        /// </summary>
        /// <param name="from">The currency value to convert.</param>
        /// <param name="toCurrency">The currency type to convert it to.</param>
        /// <returns></returns>
        Currency Convert(Currency from, CurrencyInfo toCurrency);
    }
}
